#include "businesslogic.hpp"

using lms::bussinesslogic::CustomerServices;

CustomerServices::CustomerServices():GenericRepository< Customer >( FILENAME_CUSTOMER )
{
  
}

Customer* CustomerServices::getByName(std::string fullName)
{
  Node< Customer >* first = get()->getFirst();
  while( first != null )
  {    
    Customer*  temp = first->getData();
    if( (temp != null) && (temp->getFullName().find( fullName ) != string::npos ) )    
      return temp;
    
    first  = first->getNext();
  }
  return null;
} 

